import 'package:flutter/material.dart';
import 'package:wayofdressing/contraints.dart';
import 'package:wayofdressing/components/inmenubutton.dart';
import 'package:wayofdressing/components/hordisplaywindow.dart';

class AboutUs extends StatefulWidget {
  const AboutUs({super.key});

  static String id = 'aboutus';

  @override
  State<AboutUs> createState() => _AboutUsState();
}

class _AboutUsState extends State<AboutUs> {

  Widget ctrIntroduction =Container();

  Widget hybIntroduction =Container();

  Widget scjIntroduction =Container();

  Widget lzxIntroduction =Container();

  Widget ljlIntroduction =Container();
  Widget whoseIntroduction = Container();

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    hybIntroduction=Container(
      margin: EdgeInsets.symmetric(horizontal: 30, vertical: 30),
      alignment: Alignment.topLeft,
      child: ConstrainedBox(
        constraints: BoxConstraints(
            maxWidth: 1000),
        child: Column(
          children: [
            Text('胡月冰',style: TextStyle(fontSize: 28,fontWeight: FontWeight.bold),),
            SizedBox(height:20,),
            Row(
              children: [
                Text('战斗指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            Row(
              children: [
                Text('抽象指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            Row(
              children: [
                Text('态度指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            SizedBox(height: 30,),
            Text(
              'Peanut团队设计组成员。来自湖北生态工程职业技术学院药品生物技术专业的大一学生，吃苦耐劳，能打硬仗，活跃团队气氛，喜欢发朋友圈分享生活。负责项目数据收集整理，说明文档的设计和美化，宣传片制作。',
              softWrap: true,
              style: TextStyle(color: Colors.black, fontSize: 18),
            ),
          ],
        ),
      ),
    );
    scjIntroduction =Container(
      margin: EdgeInsets.symmetric(horizontal: 30, vertical: 30),
      alignment: Alignment.topLeft,
      child: ConstrainedBox(
        constraints: BoxConstraints(
            maxWidth: 1000),
        child: Column(
          children: [
            Text('舒程锦',style: TextStyle(fontSize: 28,fontWeight: FontWeight.bold),),
            SizedBox(height:20,),
            Row(
              children: [
                Text('战斗指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            Row(
              children: [
                Text('抽象指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            Row(
              children: [
                Text('态度指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            SizedBox(height: 30,),
            Text(
              'Peanut团队UI设计师。来自浙江工业大学电子信息工程专业的大一学生，喜欢偷懒，神龙见首不见尾，不回消息，但是最后做出来的设计图不会让人失望。负责AppUI设计，思路构建。',
              softWrap: true,
              style: TextStyle(color: Colors.black, fontSize: 18),
            ),
          ],
        ),
      ),
    );
    lzxIntroduction =Container(
      margin: EdgeInsets.symmetric(horizontal: 30, vertical: 30),
      alignment: Alignment.topLeft,
      child: ConstrainedBox(
        constraints: BoxConstraints(
            maxWidth: 1000),
        child: Column(
          children: [
            Text('刘子璇',style: TextStyle(fontSize: 28,fontWeight: FontWeight.bold),),
            SizedBox(height:20,),
            Row(
              children: [
                Text('战斗指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            Row(
              children: [
                Text('抽象指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            Row(
              children: [
                Text('态度指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            SizedBox(height: 30,),
            Text(
              'Peanut团队设计组成员。来自武汉纺织大学通信工程专业的大二学生，喜欢打王者，喜欢哈哈哈大笑。负责项目数据收集，说明文档内容制作以及后端代码编写。',
              softWrap: true,
              style: TextStyle(color: Colors.black, fontSize: 18),
            ),
          ],
        ),
      ),
    );
    ljlIntroduction =Container(
      margin: EdgeInsets.symmetric(horizontal: 30, vertical: 30),
      alignment: Alignment.topLeft,
      child: ConstrainedBox(
        constraints: BoxConstraints(
            maxWidth: 1000),
        child: Column(
          children: [
            Text('梁嘉伦',style: TextStyle(fontSize: 28,fontWeight: FontWeight.bold),),
            SizedBox(height:20,),
            Row(
              children: [
                Text('战斗指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.star_half_outlined,size: 30,color: Colors.black,),
              ],
            ),
            Row(
              children: [
                Text('抽象指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            Row(
              children: [
                Text('态度指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            SizedBox(height: 30,),
            Text(
              'Peanut团队设计组成衣。来自湖北理工学院智能建造专业的大二学生，喜欢玩听歌，跑步。负责项目数据收集，流程图制作，说明文档内容制作，3D建模，辅助宣传片制作。',
              softWrap: true,
              style: TextStyle(color: Colors.black, fontSize: 18),
            ),
          ],
        ),
      ),
    );
    ctrIntroduction =Container(
      margin: EdgeInsets.symmetric(horizontal: 30, vertical: 30),
      alignment: Alignment.topLeft,
      child: ConstrainedBox(
        constraints: BoxConstraints(
            maxWidth: 1000),
        child: Column(
          children: [
            Text('程天然',style: TextStyle(fontSize: 28,fontWeight: FontWeight.bold),),
            SizedBox(height:20,),
            Row(
              children: [
                Text('战斗指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            Row(
              children: [
                Text('抽象指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            Row(
              children: [
                Text('态度指数:',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
                Icon(Icons.grade_rounded,size: 30,color: Colors.black,),
              ],
            ),
            SizedBox(height: 30,),
            Text(
              'Peanut团队的程序员。来自西南大学人工智能专业的大二学生，VIVO，平常最喜欢研究蓝心大模型。负责App代码的编写，思路构建，团队进度把控。',
              softWrap: true,
              style: TextStyle(color: Colors.black, fontSize: 18),
            ),
          ],
        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color(0xfffffaf0),
      appBar: AppBar(
        backgroundColor: Color(0xfffffaf0),
        elevation: 0,
        toolbarHeight: 80,
        leadingWidth: 100,
        centerTitle: true,
        title: Text(
          '关于我们',
          style: TextStyle(
            color: Colors.black,
            fontWeight: FontWeight.bold,
            fontSize: kTopTitleFontSize,
          ),
        ),
        leading: Row(
          children: [
            SizedBox(
              width: 10,
            ),
            GestureDetector(
              onTap: () {
                Navigator.pop(context);
              },
              child: Transform.scale(
                scaleX: -1,
                child: Icon(
                  Icons.play_arrow_rounded,
                  size: kAppBarButtonSize,
                  color: Colors.black.withOpacity(0.5),
                ),
              ),
            ),
          ],
        ),
        actions: [
          MenuAnchor(
            menuChildren: [
              InMenuButton(
                onPressed: () {},
                text: '待开发',
                alignment: Alignment.centerRight,
              ),
            ],
            style: MenuStyle(
              shape: MaterialStateProperty.all(
                RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(25.0),
                ),
              ),
              alignment: Alignment(-3, 0.5),
              padding: MaterialStateProperty.all(EdgeInsets.all(15.0)),
              shadowColor: MaterialStateProperty.all(Colors.transparent),
              backgroundColor: MaterialStateProperty.all(
                Colors.black.withOpacity(0.4),
              ),
            ),
            builder: (BuildContext context, MenuController controller,
                Widget? child) {
              return GestureDetector(
                onTap: () {
                  if (controller.isOpen) {
                    controller.close();
                  } else {
                    controller.open();
                  }
                },
                child: Icon(
                  Icons.keyboard_control_rounded,
                  size: kAppBarButtonSize,
                  color: Colors.black,
                ),
              );
            },
          ),
          SizedBox(
            width: 20,
          )
        ],
      ),
      body: Column(
        children: [
          Container(
            margin: EdgeInsets.only(bottom: 20.0),
            child: Text(
              '点击头像查看团队成员资料',
              style: TextStyle(
                  color: Colors.black,
                  fontSize: 18,
                  fontWeight: FontWeight.bold),
            ),
          ),
          HorDisplayWindow(
            list: [
              Column(
                children: [
                  GestureDetector(
                    onTap: () {
                      setState(() {
                        whoseIntroduction = ctrIntroduction;
                      });
                    },
                    child: Container(
                      margin: EdgeInsets.symmetric(horizontal: 18.0),
                      child: Row(
                        children: [
                          CircleAvatar(
                            backgroundImage: AssetImage('images/ctr.jpg'),
                            radius: 50,
                          ),
                        ],
                      ),
                    ),
                  ),
                  Text('程天然'),
                ],
              ),
              Column(
                children: [
                  GestureDetector(
                    onTap: () {
                      setState(() {
                        whoseIntroduction = scjIntroduction;
                      });
                    },
                    child: Container(
                      margin: EdgeInsets.symmetric(horizontal: 18.0),
                      child: Row(
                        children: [
                          CircleAvatar(
                            backgroundImage: AssetImage('images/scj.jpg'),
                            radius: 50,
                          ),
                        ],
                      ),
                    ),
                  ),
                  Text('舒程锦')
                ],
              ),
              Column(
                children: [
                  GestureDetector(
                    onTap: () {
                      setState(() {
                        whoseIntroduction = ljlIntroduction;
                      });
                    },
                    child: Container(
                      margin: EdgeInsets.symmetric(horizontal: 18.0),
                      child: Row(
                        children: [
                          CircleAvatar(
                            backgroundImage: AssetImage('images/ljl.jpg'),
                            radius: 50,
                          ),
                        ],
                      ),
                    ),
                  ),
                  Text('梁嘉伦')
                ],
              ),
              Column(
                children: [
                  GestureDetector(
                    onTap: () {
                      setState(() {
                        whoseIntroduction = hybIntroduction;
                      });
                    },
                    child: Container(
                      margin: EdgeInsets.symmetric(horizontal: 18.0),
                      child: Row(
                        children: [
                          CircleAvatar(
                            backgroundImage: AssetImage('images/hyb.jpg'),
                            radius: 50,
                          ),
                        ],
                      ),
                    ),
                  ),
                  Text('胡月冰')
                ],
              ),
              Column(
                children: [
                  GestureDetector(
                    onTap: () {
                      setState(() {
                        whoseIntroduction = lzxIntroduction;
                      });
                    },
                    child: Container(
                      margin: EdgeInsets.symmetric(horizontal: 18.0),
                      child: Row(
                        children: [
                          CircleAvatar(
                            backgroundImage: AssetImage('images/lzx.jpg'),
                            radius: 50,
                          ),
                        ],
                      ),
                    ),
                  ),
                  Text('刘子璇')
                ],
              ),
            ],
          ),
          Expanded(
            flex: 4,
            child:whoseIntroduction,
          ),
        ],
      ),
    );
  }
}
